home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1995 December / PC Answers December 1995 (disc errors).iso / mxc / macinstr.dir / 00007.ls < prev    next >
Encoding:
Text File  |  1995-05-03  |  1.8 KB  |  62 lines

  1. global gSlot, gPrefPath, gsliderbar, gVolume, XJack, xPal, gdirmovie
  2.  
  3. on startMovie
  4.   if the machineType = 256 then
  5.     openXLib("XPALETTE.dll")
  6.     set xPal to XPALETTE(mnew)
  7.     openXLib("xmisc.dll")
  8.     set lFred to XMisc(mnew)
  9.     set lSysFolder to lFred(mGetSysDir)
  10.     closeXLib("xmisc.dll")
  11.     set gPrefPath to lSysFolder & "\SFF02.ini"
  12.   else
  13.     openXLib("XPALETTE")
  14.     set xPal to fixPalette(mnew, the stageLeft, the stageTop, the stageRight, the stageBottom)
  15.     openXLib("sysfold.xcmd")
  16.     set lSysFolder to systemFolder()
  17.     closeXLib("sysfold.xcmd")
  18.     set gPrefPath to lSysFolder & "Preferences:SFF02 prefs"
  19.   end if
  20.   set XJack to FileIO(mnew, "read", gPrefPath)
  21.   if XJack = -43 then
  22.     set Xwrite to FileIO(mnew, "write", gPrefPath)
  23.     Xwrite(mWriteString, "1255")
  24.     Xwrite(mdispose)
  25.     set XJack to FileIO(mnew, "read", gPrefPath)
  26.   end if
  27.   set lPrefFile to XJack(mReadFile)
  28.   if lPrefFile = EMPTY then
  29.     if the machineType = 256 then
  30.       alert("Please install Fly Fishing School")
  31.       quit()
  32.     else
  33.       alert("No pref file")
  34.       quit()
  35.     end if
  36.   else
  37.     set gsliderbar to char 1 of lPrefFile
  38.     set gsliderbar to integer(gsliderbar)
  39.     set gVolume to char 2 to 4 of lPrefFile
  40.     set gVolume to integer(gVolume)
  41.     if the number of lines in lPrefFile = 1 then
  42.       put field "Preferences-BU" into field "Preferences"
  43.     else
  44.       put lPrefFile into field "Preferences"
  45.       delete line 1 of field "Preferences"
  46.     end if
  47.   end if
  48. end
  49.  
  50. on writeFile
  51.   set Xwrite to FileIO(mnew, "write", gPrefPath)
  52.   put gsliderbar & gVolume & RETURN before line 1 of field "Preferences"
  53.   set lWritePrefs to field "Preferences"
  54.   Xwrite(mWriteString, lWritePrefs)
  55.   Xwrite(mdispose)
  56.   delete line 1 of field "Preferences"
  57. end
  58.  
  59. on closeMovie
  60.   XJack(mdispose)
  61. end
  62.